package com.gxc.authcore.system.util;

import com.gxc.authcore.system.domain.Log;
import com.gxc.authcore.system.service.LogService;
import com.gxc.webcore.util.ContextUtil;
import com.gxc.webcore.util.StringUtil;

public class LogUtil {

	/**
	 * 记录日志
	 * 
	 * @param log
	 */
	public static void createLog(Log log) {
		LogService logService = (LogService) ContextUtil
				.getBean(LogService.class);
		if (log.getId() == null || log.getId().trim().equals("")) {
			log.setId(StringUtil.getUUID());
		}
		logService.create(log);
	}

}
